home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
syncrnet
/
oneline1.zip
/
ONELINER.SRC
< prev
next >
Wrap
Text File
|
1996-04-21
|
8KB
|
290 lines
# ┌──────────────────────────────────────────────────────────────────────────┐
# │ ONELINER.SRC (Chuckle Box One-Liners) │
# │ │
# │ Version: 1.0 (Released 21 Apr 1996) for SBBS 2.20 - Rev B │
# │ Author: Robert Nykvist aka Chuckles@LAUGHBOX │
# │ Support BBS: The Chuckle Box BBS (334) 653-1888 │
# │ │
# │ Quick Start: 1. Move ONELINER.SRC to your \EXEC directory. │
# │ 2. Edit paths in script as needed for your system. │
# │ 3. Compile ONELINER.SRC with Baja compiler. │
# │ 4. Make script available to your callers. │
# │ │
# │ NOTE: This script uses file I/O commands to create │
# │ and append to One-Liner file. Check the paths! │
# │ It also awards users with credits for posting. │
# └──────────────────────────────────────────────────────────────────────────┘
!INCLUDE SBBSDEFS.INC
!INCLUDE FILE_IO.INC
# Top of Generic Menu.
:top
CMD_HOME
cls
crlf
crlf
crlf
crlf
crlf
print "nh¥7█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀k▄0"
crlf
print "¥w7█ nk7┌─────────────hw┐ k█0"
crlf
print "¥w7█ nk7│ OneLiners hw│ k█0"
crlf
print "¥w7█ nk7│ r─────────── hw│ k█0"
crlf
print "¥w7█ nk7│ hyVnb7iew hw│ k█0"
crlf
print "¥w7█ nk7│ hyAnb7dd hw│ k█0"
crlf
compare_ars SYSOP
if_true
print "¥w7█ nk7│ hyEnb7dit hw│ k█0"
crlf
end_if
print "¥w7█ nk7│ hyQnb7uit hw│ k█0"
crlf
print "¥w7█ nk7└hw─────────────┘ k█0"
crlf
print "¥w7▀k▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█0n"
crlf
crlf
crlf
crlf
crlf
# Give SysOp Prompt for his Extra EDIT command.
compare_ars SYSOP
if_true
print "wh Enter (yVw/yAw/yEw/yQw) : n"
else
print "wh Enter (yVw/yAw/yQw) : n"
end_if
# Get User Input : View, Add or Quit (Cmd-E only works for SysOp)
node_action node_xtrn
sync
getcmd AEQV?
# Redisplay Menu
cmdkey ?
cmd_pop
goto top
end_cmd
# Add a One-Liner. Goto WRITE
cmdkey A
cmd_pop
goto write
end_cmd
# Edit Option for SysOp. Paths Uses "cstr" string (double slashes).
cmdkey E
compare_ars SYSOP
if_true
crlf
# ┌──────────────────────────────────────┐
# │ P A T H C H E C K W A R N I N G │
# └──────────────────────────────────────┘
setstr "d:\\xtrn\\liners\\oneline.dab"
ungetstr
edit_text_file
end_if
cmd_pop
goto top
end_cmd
# Quit Script. Goto BYEBYE
cmdkey Q
cmd_pop
goto byebye
end_cmd
# View One-Liners. Customize your own header Info.
cmdkey V
:View
cls
crlf
print " nrChhyuwckle Box One-Linyerrnrs"
crlf
print "hw──────────────────────────────────────────────────────────────────────────────n"
# ┌──────────────────────────────────────┐
# │ P A T H C H E C K W A R N I N G │
# └──────────────────────────────────────┘
# Checking to see if file is there. If so, print most recent 16 lines.
chkfile "d:\xtrn\liners\oneline.dab"
if_true
setstr "d:\\xtrn\\liners\\oneline.dab"
# P_NOATCODES disables expansion of SYSTEM variables like @USER@
# Replace the below P_NOATCODES with 0 to have some variable fun. <Chuckle>
# e.g. : All are invited to @USER@'s house for a wild party...
printtail str P_NOATCODES 16
else
crlf
print "yh No one has written yet, or the SysOp has screwed up somewhere."
crlf
end_if
print "hw──────────────────────────────────────────────────────────────────────────────n"
crlf
pause
cmd_pop
goto top
end_cmd
# Add One-Liner
:Write
cls
crlf
crlf
# Define One-Liner String Variable. Send them Prompt Info.
str one
print "rhWrite something fun now. y (w1nc-Linehy) nm Press ENTER when done."
crlf
crlf
print "hy > "
# Get user input - Variable ONE.
sync
getstr one 70 K_LINE|K_NOEXASC|K_MSG
# If NULL input, take them back to the Top of the Menu.
compare one ""
if_true
cmd_pop
goto top
end_if
# Otherwise, Let them see what they have done. Display it.
:displayit
crlf
print "rh─────────────────────────────────────────────────────────────────────────────hw"
crlf
print "n■ hy"
print one
crlf
print "rh─────────────────────────────────────────────────────────────────────────────n"
crlf
crlf
# Double check to see if they want to post it or not.
print "rhIs this OK to post? y (wYn/hwNy) > n"
sync
getcmd YN
# Post One-Liner
cmdkey Y
# This area blocked off. If you have SmegBEEP and wish to censor input
# Unblock/Edit the below code and recompile.
# copy str one
# exec_bin smegbeep
# compare str "Censored"
# if_true
# crlf
# print "rhNasty A$$ Word Detected - wPost Aborted..."
# crlf
# crlf
# pause
# cmd_pop
# goto top
# end_if
# Adding random color variety to the one-liners using RANDOM & COMPARE.
# Can be over-ridden by use of Ctrl_A codes allowed in getstr input.
# Define Random Variable & String
int number
str two
random number 7
compare number 0
if_true
set two "n■ hm"
end_if
compare number 1
if_true
set two "n■ hg"
end_if
compare number 2
if_true
set two "n■ hw"
end_if
compare number 3
if_true
set two "n■ hr"
end_if
compare number 4
if_true
set two "n■ hc"
end_if
compare number 5
if_true
set two "n■ hy"
end_if
compare number 6
if_true
set two "n■ hb"
end_if
# Define File Variable
int file
# Appending user input to end of ONELINE.DAB file.
# Open File. If non-existant, create it.
# ┌──────────────────────────────────────┐
# │ P A T H C H E C K W A R N I N G │
# └──────────────────────────────────────┘
fopen file O_CREAT|O_WRONLY|O_APPEND "d:\xtrn\liners\oneline.dab"
# Print Random Ctrl-A Color (Variable TWO from above)
fprintf file "%s" two
# Print User Input to file, and end with Ctrl-A code "(" - It hides text.
fprintf file "%sn( [" one
# User number is hidden from users with less than 90 security level.
# You can change that level. See page 244, 8/95 -SysOp Manual
# After printing user Number, restore display ")" and add return.
copy str _USERON.NUMBER
fprintf file "%s])\r\n" str
# Close the lid and flush. <Chuckle>
fclose file
# Alert SysOp of One-Liner Post so he/she can quickly go check it out. <G>
# ┌──────────────────────────────────────┐
# │ P A T H C H E C K W A R N I N G │
# └──────────────────────────────────────┘
exec "command /c echo mh%a whas added a One-Liner! >> c:\sbbs\data\msgs\0001.msg"
crlf
crlf
# Adding Visual Dynamics for User pleasure. <Chuckle>
print "rhSaving Post, ., ., . wThanks for postingy @USER@!
crlf
crlf
# Incentive for users to post (Participate). Free Credits. :)
print "cAdding m25 k ccredits to your account."
crlf
crlf
pause
adjust_user_credits 25
cmd_pop
goto top
# End Cmdkey Y
end_cmd
# Darn, they changed their mind. Don't Add Post, go back to top of menu.
cmdkey N
cmd_pop
goto top
end_cmd
# FALL THROUGH (Just in case...)
cmd_pop
goto top
# Exit Script
:byebye